import 'dart:convert';
import "dart:collection";
import 'package:flutter/services.dart';
import 'package:crypto/crypto.dart';
import 'package:http/http.dart' as http;
import 'package:archime/model/robot_message.dart';
import 'package:archime/event/event_robot_respone.dart';

class CommonUtil{
  static const MethodChannel methodChannel = MethodChannel('archime/common');

  Future<void> getBatteryLevel() async {
    String batteryLevel;
    try {
      final int result = await methodChannel.invokeMethod('getBatteryLevel');
      batteryLevel = 'Battery level: $result%.';
    } on PlatformException {
      batteryLevel = 'Failed to get battery level.';
    }
  }
}